package com.ticket.sass.common.entity.tenant;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 
 * </p>
 *
 * @author ywb
 * @since 2024-05-07
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("take_ticket_orders")
@ApiModel(value="TakeTicketOrdersEntity对象", description="")
public class TakeTicketOrderEntity implements Serializable {
    @ApiModelProperty(value = "取票订单ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "取票码")
    private String takeCode;

    @ApiModelProperty(value = "影片名称")
    private String filmName;

    @ApiModelProperty(value = "影厅code")
    private String hallCode;

    @ApiModelProperty(value = "影厅名称")
    private String hallName;

    @ApiModelProperty(value = "场次编码")
    private String sessionCode;

    @ApiModelProperty(value = "影片编码")
    private String filmCode;

    @ApiModelProperty(value = "开场时间")
    private LocalDateTime startTime;

    @ApiModelProperty(value = "结束时间")
    private LocalDateTime endTime;

    @ApiModelProperty(value = "电影票数量")
    private Integer ticketNum;

    @ApiModelProperty(value = "影片ID")
    private Long filmId;

    @ApiModelProperty(value = "用户ID")
    private Long userId;

    @ApiModelProperty(value = "排期ID")
    private Long filmScheduleId;

    @ApiModelProperty(value = "渠道编码")
    private String channelCode;

    @ApiModelProperty(value = "渠道名称")
    private String channelName;

    @ApiModelProperty(value = "影院ID")
    private Long cinemaId;

    @ApiModelProperty(value = "租户ID")
    private Long tenantId;
    
    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    public LocalDateTime createdAt;
    
    @ApiModelProperty(value = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    public LocalDateTime updatedAt;
    
    @TableField(select = false)
    @ApiModelProperty(value = "删除时间")
    @TableLogic(value = "null", delval = "now()")
    public LocalDateTime deletedAt;

    @TableField(value = "cellphone", exist = false)
    private String cellphone;
    
    @TableField(value = "total_orders", exist = false)
    private Integer totalOrders;
    
    @TableField(value = "total_tickets", exist = false)
    private Integer totalTickets;
    

    @TableField(exist = false)
    private FilmEntity film;

    @TableField(exist = false)
    private List<TakeTicketEntity> takeTicketList;

    @TableField(exist = false)
    private FilmScheduleEntity filmSchedule;

    @TableField(exist = false)
    private CinemaEntity cinema;
}
